#!/bin/bash

# 启用rabbitMQ管理插件
rabbitmq-plugins enable rabbitmq_management

# 通过运行以下命令, 将RabbitMQ文件的所有权提供给RabbitMQ用户
chown -R rabbitmq:rabbitmq /var/lib/rabbitmq/

# 创建用户
rabbitmqctl add_user admin {{ rabbitmq_admin_password }}		# admin123456@是密码
rabbitmqctl set_user_tags admin administrator
rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"